/**
 * 获取审批详情mixins
 */
import {REVIEW_DIC} from '@/const/dict'
import {reviewDetail} from "@/api/review";
import {getfileinfo,getfileinfopage} from "@/api/system"
import {getNotNull,dealStartEndDate,getFileTypeFile,getFileTypeFiles} from '@/views/util'
export default function () {
  return {
    data() {
      return {
        reviewDetailData:[],
      }
    },
    methods: {
      async getDetailData_review(id){
        reviewDetail(id).then(async response => {
          var records = response.data.data
          let bswjFiles = await getFileTypeFiles(records.reportFileIds,'报送文件')
          let qtfjFiles = await getFileTypeFiles(records.otherFileIds,'其他附件')
          let bzsmFiles = await getFileTypeFile(records.instruction,'编制说明')
          let ghwbFiles = await getFileTypeFile(records.txt,'规划文本')
          let xjyjFiles = await getFileTypeFile(records.connectOpinion,'衔接意见')
          let zjpsyjFiles = await getFileTypeFile(records.expertOpinion,'专家评审意见')
          if(this.reviewForm){
            this.reviewForm.openScope = records.openScope
          }
          if(this.reviewForm){
            this.reviewForm.releaseWay = records.releaseWay
          }
          this.reviewDetailData = [
            {label:'标题',value:getNotNull(records.title)},
            {label:'报送文件',files:bswjFiles},
            {label:'拟发布范围',value: getNotNull(records.openScope,REVIEW_DIC.publishDIC)},
            {label:'编制说明',files:bzsmFiles},
            {label:'规划文本',files:ghwbFiles},
            {label:'衔接意见',files:xjyjFiles},
            {label:'专家评审意见',files:zjpsyjFiles},
            {label:'其他附件',files:qtfjFiles}
          ]
        })
      },
    }
  }
}
